Image data acquired via an image sensing device in an image processing apparatus such as a digital camera is subjected to A/D conversion. In many cases, the resulting digital data is then subjected to necessary image processing, and lossy compression such as JPEG encoding is executed on the processed data. The compressed data is stored in a storage medium as JPEG image data. This enables a large number of image data to be efficiently stored in a storage medium having a limited storage capacity.
To focus on image quality, all information obtained via an image sensing device (hereinafter also referred to as “CCD-RAW data”) is subjected to lossless compression instead of image processing inside an image processing apparatus such as a digital camera before being stored in a storage medium. The stored image data (hereinafter referred to as “compressed RAW data”) is then subjected to image processing using computer software or the like provided by a digital camera manufacturer or the like. Users can then obtain high-quality images. In this case, each compressed RAW data is stored simultaneously with the corresponding JPEG image data. The user can thus check stored images on the fly, save them as they are, or print them out.
To generate compressed RAW data or JPEG image data from CCD-RAW data, a digital camera encodes the CCD-RAW data on the basis of various encode parameters. The encode parameters indicate, for example, the type of a Huffman table for Huffman encoding in the digital camera and the type of a quantization table for quantization. The compression ratio of compressed RAW data or JPEG image data varies depending on the types of encode parameters used. The Huffman table indicates what code is to be assigned to what value.
Many conventional digital cameras efficiently store images in a storage medium by selectively applying a preferred one of plural encode parameters so as to maximize the compression ratio. For example, Japanese Patent Laid-Open No. 2001-326939 proposes a technique for experimentally executing encoding with each of the plural encode parameters held in a storage unit and adopting an encode parameter resulting in the maximum compression ratio.
However, the conventional technique in Japanese Patent Laid-Open No. 2001-326939 must experimentally execute encoding with all of the plural encode parameters held in the storage unit, thus increasing the time required to process each image data. This disadvantageously degrades the response of the apparatus and reduces the continuous shooting speed and continuous shooting frame count.
The present invention is made in view of these circumstances and is characterized by providing a technique for quickly selecting an encode parameter for an image encoding apparatus which achieves high compression efficiency.